#include"DEMOGameState_Gameplay.h"

DEMOGameState_Gameplay::DEMOGameState_Gameplay()
{

}

DEMOGameState_Gameplay::~DEMOGameState_Gameplay()
{
	
}

void DEMOGameState_Gameplay::OnInit(DEMOGameState_Context* const ownerContext)
{
	DEMOGameState_Base::OnInit(ownerContext);
	loadMapData();

	_tankFactory = new DEMOTank_Factory();
	_tank = _tankFactory->generateTank( ETT_Trial);
}

void DEMOGameState_Gameplay::OnDestroy()
{
	destroyMapData();

	if( _tankFactory != NULL )
	{
		delete _tankFactory;
		_tankFactory = NULL;
	}

	if( _tank )
	{
		delete	_tank;
		_tank = NULL;
	}
}

void DEMOGameState_Gameplay::loadMapData()
{
	
}

void DEMOGameState_Gameplay::destroyMapData()
{
	
}

bool DEMOGameState_Gameplay::Tick(float dt)
{
	_tank->tick(dt);

	return false;
}

bool DEMOGameState_Gameplay::OnInput(hgeInputEvent theEvent)
{
	_tank->OnInput( theEvent);
	return false;
}

bool DEMOGameState_Gameplay::Render()
{
	return false;
}